#include <iostream>
#include <vector>
#include <numeric>
#include <algorithm>
using namespace std;

bool cmp(int a, int b)
{
    return a>b;
}

int main()
{
    int n,k,m;
    cin>>n>>k>>m;
    vector<vector<int>>scores(n);
    for (int i=0;i<n;i++)
    {
        for (int j=0;j<k;j++)
        {
            int p;
            cin>>p;
            scores[i].push_back(p);
        }
        sort(scores[i].begin(),scores[i].end());
    }
    vector<double>average(n);
    for (int i=0;i<n;i++)
    {
        double sum=accumulate(scores[i].begin(),scores[i].end(),0)-scores[i][0]-scores[i][k-1];
        average[i]=sum/(k-2);   
    }
    sort(average.begin(),average.end(),cmp);
    for (int i=m-1;i>=0;i--)
    {
        if (i==m-1)
            printf("%.3f",average[i]);
        else
            printf(" %.3f",average[i]);
    }
}